package homework.day08;

import java.util.*;

/**
 * @Classname: HomeWork03
 * @Author: bromide
 * @CreateTime: 2022/4/6--18:59
 * @Version: V1.0
 * @Description: 生成10个0-100之间的不重复的随机数,并输出
 */
public class HomeWork03 {
    public static void main(String[] args) {
        Set<Integer> set = new HashSet<>();
        Random random = new Random();
        /*for (int i = 0; i < 10; i++) {
            set.add(random.nextInt(100));
        }*/
        while (set.size() < 10) {
            int i = random.nextInt(100);
            set.add(i);
        }
        System.out.println(set);
    }
}
